From: Brion Vibber Date: Fri, 9 Apr 2004 00:45:15 +0000 (+0000) Subject: Revert breakage in secureAndSplit() which failed to remove head/trail X-Git-Tag: 1.3.0beta1~547 X-Git-Url: http://git.cyclocoop.org/%22.%24match%5B1%5D.%22?a=commitdiff_plain;h=d8dc024eb406df2d035abd862636cd442a131a83;p=lhc%2Fweb%2Fwiklou.git Revert breakage in secureAndSplit() which failed to remove head/trail whitespace if provided as underlines. --- diff --git a/includes/Title.php b/includes/Title.php index 365378e529..18bec83643 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -601,7 +601,15 @@ class Title { # Clean up whitespace # - $t = preg_replace( "/[\\s_]+/", "_", trim($this->mDbkeyform) ); + $t = preg_replace( "/[\\s_]+/", "_", $this->mDbkeyform ); + if ( "_" == @$t{0} ) { + $t = substr( $t, 1 ); + } + $l = strlen( $t ); + if ( $l && ( "_" == $t{$l-1} ) ) { + $t = substr( $t, 0, $l-1 ); + } + if ( "" == $t ) { wfProfileOut( $fname ); return false;